import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/RegisterView.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/my-learning',
    name: 'myLearning',
    component: () => import('../views/MyLearningView.vue')
  },
  {
    path: '/course',
    name: 'Course',
    component: () => import('../views/Course.vue')
  },
  {
    path: '/learning-path',
    name: 'LearningPath',
    component: () => import('../views/LearningPathSurvey.vue')
  },
  {
    path: '/cangjie-oj',
    name: 'CangjieOJList',
    component: () => import('../views/CangjieOJList.vue')
  },
  {
    path: '/cangjie-oj/:id',
    name: 'CangjieOJDetail',
    component: () => import('../views/CangjieOJDetail.vue')
  },
  {
    path: '/course-survey',
    name: 'CourseLearningSurvey',
    component: () => import('../views/CourseLearningSurvey.vue')
  },
  {
    path: '/category-detail',
    name: 'CategoryDetail',
    component: () => import('../views/CategoryDetail.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router